import request from '@/utils/request'

// 借款申请
export function loanapply(data) {
  return request({
    url: '/transaction/loanApply',
    method: 'post',
    data:data
  })
}

// 获取借款申请列表
export function getLoanApplyList(data) {
  return request({
    url: '/transaction/loanApply',
    method: 'get',
    params:data
  })
}

// 审批借款（更新借款申请的状态）
export function updateloanApplystate(data) {
  return request({
    url: '/transaction/loanApply',
    method: 'put',
    data:data
  })
}

// 我的借款
export function myLoeanApply(data) {
  return request({
    url: '/transaction/myLoan',
    method: 'get',
    params:data
  })
}

// 债权
export function mydebt(data) {
  return request({
    url: '/transaction/debt',
    method: 'get',
    params:data
  })
}

// 还款计划列表
export function myRepayPlan(data) {
  return request({
    url: '/transaction/RepayPlan',
    method: 'get',
    params:data
  })
}

// 还款计划列表
export function DefiniteRepayment(data) {
  return request({
    url: '/transaction/RepayPlan',
    method: 'post',
    data:data
  })
}

// 投资记录
export function AccessInvestmentRecords(data) {
  return request({
    url: '/transaction/invest_record',
    method: 'get',
    params:data
  })
}

// 交易记录
export function getTransactionRecord(data) {
  return request({
    url: '/transaction/deal_record',
    method: 'get',
    params:data
  })
}

// 预期收益
export function ExpectedReturn(data) {
  return request({
    url: '/transaction/exceptedReturn',
    method: 'get',
    params:data
  })
}

// 获得收益
export function getIncome(data) {
  return request({
    url: '/transaction/getIncome',
    method: 'post',
    data:data
  })
}
